const express = require("express");
const app = express();
const core = require("cors");
// 引入body-parser 解析post请求传过来的参数
const bodyParser = require("body-parser");
const router = require("./routes/index");
// app.use 注册中间件 中间件的使用： npm i require app.use
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({ extended: false }));
app.use(core());
app.use("/user", router);

app.listen(3020, () => {
  console.log("serve runing at http://127.0.0.1:3020");
});
